{extend name="public/base"/}
{block name="body"}
<link rel="stylesheet" type="text/css" href="/static/css/boxImg.css">
<style type="text/css">
	.attrs{margin-top:5px;}
	.attrname{width:100px;border:solid 1px #ddd;height:31px;font-size:14px;padding-left:4px;}
	.attrval{width:40%;border:solid 1px #ddd;height:31px;font-size:14px;padding-left:4px;}
</style>
<title>订单详情</title>
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
		<input type="hidden" class="input-text" value="{$data.id}" id="id" name="id">
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">产品：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.title}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">图片：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<img modal="zoomImg" style="width:50%" src="{$data.img}">
				<!-- <img border="0" src="{$data.img}" onmousewheel="return rollImg(this)"> -->
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">收货人：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.name}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">收货人电话：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.address_phone}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">收货地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.address}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">订单号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.order_no}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">积分单价：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.score}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">购买数量：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.buy_num}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">支付积分：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.scores}
			</div>
		</div>
		{if $data.state==1}
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">快递公司：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.express_company}" placeholder="快递公司" id="express_company" name="express_company">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">快递单号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$data.express_no}" placeholder="快递单号" id="express_no" name="express_no">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input id="submit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;发货&nbsp;&nbsp;">
			</div>
		</div>
		{else}
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">快递公司：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.express_company}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-3 col-sm-2">快递单号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				{$data.express_no}
			</div>
		</div>
		{/if}
	</form>
</article>


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="/static/js/boxImg.js"></script> 
<script type="text/javascript">

$("#submit").click(function() {
	layer.load(1, {
	  shade: [0.1,'#fff'] //0.1透明度的白色背景
	});
	var id=$("input[name=id]").val();
	var express_company=$("input[name=express_company]").val();
	var express_no=$("input[name=express_no]").val();
    $.ajax({
	    type: 'POST',
	    url: "{:url('order_detail')}",
	    data: {id:id,express_company:express_company,express_no:express_no},
	    success: function(resdata){
	        if(resdata.code==200){
				layer.msg(resdata.msg,{icon:1,time:1000});
				setTimeout("location.reload()",1000);
	        }else{
				layer.msg(resdata.msg,{icon:2,time:3000});
	        }
	    },
	    error: function(){
			layer.msg('数据保存失败',{icon:2,time:3000});
	    }
	})
})
</script> 
{/block}